package com.huang.enums;

/**
 * @author han
 * @since 2022-01-16 15:43:26
 */
public enum CommonCodeEnum implements ResultStatusCode {
    /**
     * 通用状态码定义
     */
    SUCCESS(200, "成功"),

    SERVER_ERROR(500, "服务异常"),

    PARAMETER_ERROR(500, "非法参数异常"),

    FLOW_LIMIT_ERROR(500, "您被限流了"),

    DEGRADE_LIMIT_ERROR(500, "您被熔断了"),

    PARAM_ERROR(9000, "参数错误"),

    PARAM_FILE_EMPTY_ERROR(9000, "%s"),

    ;

    private final int code;

    private final String msg;

    CommonCodeEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMsg() {
        return msg;
    }
}
